home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
doom
/
cddk9605.zip
/
HEADERS.ARJ
/
VIDEO.INT
< prev
next >
Wrap
Text File
|
1996-05-17
|
16KB
|
413 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ Name : VIDEO.PAS }
{ Description : A wide selection of video routines }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT Video;
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
CONST
{ ANSI Constants }
ANSI_ClrEOL = #27'[K';
ANSI_ClrScr = #27'[2J';
ANSICmdChrs = ['A'..'D','f','H','h','J','K','l','m','p','s','u'];
ANSIParChrs = ['0'..'9','?'];
ESC = #27;
ISO_6429 : ARRAY[0..7] OF Byte = (0,4,2,6,1,5,3,7);
ISO_6429c : ARRAY[0..7] OF Char = ('0','4','2','6','1','5','3','7');
{ AVATAR Constants }
AVATARClrScrColor : Byte = 3;
AVTBlack = ^V^A#0; AVTDarkGray = ^V^A#8;
AVTBlue = ^V^A#1; AVTLightBlue = ^V^A#9;
AVTGreen = ^V^A#2; AVTLightGreen = ^V^A#10;
AVTCyan = ^V^A#3; AVTLightCyan = ^V^A#11;
AVTRed = ^V^A#4; AVTLightRed = ^V^A#12;
AVTMagenta = ^V^A#5; AVTLightMagenta = ^V^A#13;
AVTBrown = ^V^A#6; AVTYellow = ^V^A#14;
AVTLightGray = ^V^A#7; AVTWhite = ^V^A#15;
{ CGA Constants }
CGA_Size40 = $00; { -------0 } { CGA Control Register }
CGA_Size80 = $01; { -------1 } { Port $3D8 }
CGA_Txt = $00; { ------0- }
CGA_Gfx = $02; { ------1- }
CGA_Color = $00; { -----0-- }
CGA_Mono = $04; { -----1-- }
CGA_HighOff = $00; { ----0--- }
CGA_HighOn = $08; { ----1--- }
CGA_LoRes = $00; { ---0---- }
CGA_HiRes = $10; { ---1---- }
CGA_BlinkOff = $00; { --0----- }
CGA_BlinkOn = $20; { --1----- }
{ Color Constants }
Black = 0; DarkGray = 8; BlackBG = $00;
Blue = 1; LightBlue = 9; BlueBG = $10;
Green = 2; LightGreen = 10; GreenBG = $20;
Cyan = 3; LightCyan = 11; CyanBG = $30;
Red = 4; LightRed = 12; RedBG = $40;
Magenta = 5; LightMagenta = 13; MagentaBG = $50;
Brown = 6; Yellow = 14; BrownBG = $60;
LightGray = 7; White = 15; LightGrayBG = $70;
Blink = 128;
{ Video Segments }
CSeg = $B800; { Video segment for color monitors }
MSeg = $B000; { Video segment for monochrome monitors }
VSeg = $A000; { Video segment for VGA systems in mode 13h }
{ Pel/Pixel Ports }
PelAddrR = $3C7;
PelAddrW = $3C8;
PelData = $3C9;
{ PrintScreenStatus Constants }
PrtSc_NotActive = $00;
PrtSc_InProgress = $01;
PrtSc_Error = $FF;
{ TextGfx Constants }
_ASCII = 0; { -------- }
_ANSI = 1; { -------1 }
_AVATAR = 2; { ------1- }
TYPE
t80x25 = ARRAY[0..4000] OF Byte;
p80x25 = ^t80x25;
tCharSpec = RECORD
Ch : Char; { Character }
At : Byte; { Attribute }
END;
pCharSpec = ^tCharSpec;
tRGB = RECORD
R : Byte; { Red }
G : Byte; { Green }
B : Byte; { Blue }
END;
pRGB = ^tRGB;
tPalette64 = ARRAY[0..63] OF tRGB;
pPalette64 = ^tPalette64;
tPalette256 = ARRAY[0..255] OF tRGB;
pPalette256 = ^tPalette256;
CONST
Faded : Boolean = False;
ScreenPtr : Pointer = NIL;
VAR
OriginalVideoMode : Byte;
PrintScreenStatus : Byte ABSOLUTE $0050:$0000;
VAR
ATI_Revision : Byte ABSOLUTE $C000:$0043;
{ 31h = 18800 }
{ 32h = 18800-1 }
{ 33h = 18800-2 }
{ 34h = 18800-4 }
{ 35h = 18800-5 }
{ 62h = 68800AX (Mach32) }
ATI_Adapter : Word ABSOLUTE $C000:$0040;
{ "22" = EGA Wonder }
{ "31" = VGA Wonder }
{ "32" = EGA Wonder800+ }
ATI_Features : Byte ABSOLUTE $C000:$0042;
{ bit 1 = mouse port present }
{ bit 4 = programmable video clock }
ATI_FeaturesPlus : Byte ABSOLUTE $C000:$0044;
{ Contains additional flags if chipset > 30h. }
{ bit 0 = 70 Hz non-interlaced display }
{ bit 1 = Korean (double-type) characters }
{ bit 2 = 45 Mhz memory clock rather than 40 Mhz }
{ bit 3 = zero wait states }
{ bit 4 = paged ROMs }
{ bit 6 = no 8514/A monitor support }
{ bit 7 = HiColor DAC }
FUNCTION ANSI_Color(CONST P:ARRAY OF Byte; From:Byte):Byte;
{ Calculates the new text color based on the parameters from an ANSI }
{ color sequence. P[0] contains the number of parameters in the array. }
FUNCTION ANSI_SYS_Driver:Boolean;
{ Returns TRUE if ANSI.SYS is loaded on the local machine. }
PROCEDURE BLoad80x25(p:p80x25);
PROCEDURE BSave80x25(p:p80x25);
{ These two procedures are similar to the BLOAD and BSAVE statements in }
{ BASIC. The first procedure copies the contents of the 80 x 25 text }
{ screen into a buffer. The second procedure copies the contents from a }
{ buffer to the video screen. No range checking or memory allocation is }
{ performed. }
PROCEDURE CursorOff;
PROCEDURE CursorOn;
{ These two procedures control the visibility of the cursor without }
{ affecting its attributes (i.e. size). Very old BIOSs are supported. }
FUNCTION DetectAheadAdapter : Boolean;
FUNCTION DetectATIAdapter : Boolean;
FUNCTION DetectGenoaAdapter : Boolean;
FUNCTION DetectOakTechChipSet : Boolean;
FUNCTION DetectParadiseAdapter : Boolean;
{ These functions attempt to detect a video card by searching for its }
{ particular signature. }
FUNCTION DoorSys_2_Graphics(p:pChar):Byte;
{
PURPOSE : Converts a DOOR.SYS graphics string to the system used by
this unit.
NOTES : NG = 0 (_ASCII)
GR = 1 (_ANSI)
}
FUNCTION EGA_BIOS:Boolean;
{ Detects the presense of an EGA-compatible BIOS. }
PROCEDURE FadeIn(d:Word);
PROCEDURE FadeOut(d:Word);
{ These two procedures cycle the color palette to produce a smooth fading }
{ affect. An EGA/VGA graphics card is required. }
FUNCTION GenoaAdapter:Byte;
{ Returns the Genoa model: }
{ 00h = Genoa 6200/6300 }
{ 11h = Genoa 6400/6600 }
{ 22h = Genoa 6100 }
{ 33h = Genoa 5100/5200 }
{ 55h = Genoa 5300/5400